package main

import (
	"cluster-cache/rpc"
	"encoding/json"
)

type Response struct {
	Message string `json:"message"`
}

var hello = &Response{Message: "Hello, World!"}

type MockRouter struct {
}

func (m *MockRouter) Publish(codec *rpc.HttpCodec, body []byte) {
	data, _ := json.Marshal(hello)
	codec.Append200JsonData(data)
}

func main() {
	server := rpc.NewHttpServerV1("0.0.0.0:8080", &MockRouter{})
	server.Start()
}
